<?php

namespace App\Http\Requests\Auth;

use Illuminate\Foundation\Http\FormRequest;

class SellerAuthRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            "card_front"     => "required",
            "card_back"      => "required",
            "realname"       => "required|string",
            "id_card"        => "required|string",
            "start_time"     => "required|date|before:end_time",
            "end_time"       => "required|date|after:start_time",
            "alipay_name"    => "string",
            "alipay_no"      => "requiredWith:alipay_name",
            "alipay_code"    => "requiredWith:alipay_name",
            "wechat_name"    => "string",
            "wechat_no"      => "requiredWith:wechat_name",
            "wechat_code"    => "requiredWith:wechat_name",
            "id"             => "sometimes",
            "contact_type"   => "required|in:0,1",
            "contact_info"   => "required|string",
        ];
    }
}
